<template>
  <i class="ty-icon" style="style" v-html="unicode"></i>
</template>

<script>
import { computed, toRefs } from '@vue/composition-api';
const map = {
    'success': '&#xe65c;',
    'fail': '&#xe6a1;',
}
export default {
    name: 'ty-icon',
    props: {
        name: String,
        color: String,
    },
    setup(props) {
        const { name, color } = toRefs(props)
        const unicode = computed(() => {
            return map[name.value]
        })
        const style = computed(() => {
            return {
                color: color.value
            }
        })

        return {
            unicode,
            style,

        }
    }
};
</script>

<style scoped>
.ty-icon {
  font-family: "iconfont" !important;
  font-size: 36px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke-width: 0.2px;
  -moz-osx-font-smoothing: grayscale;
}
</style>